<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
    <!-- 参考文档： https://jqweui.com/components#buttons -->
    <!-- head 中 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
</head>
<body>
<div class="weui-cells__title">CODE:</div>
<div class="weui-cells">
    <div class="weui-cell">
        <div class="weui-cell__bd">
            <input id="code" class="weui-input" type="text" placeholder="请输入code">
        </div>
    </div>
</div>
<button onclick="loop2()" class="weui-btn weui-btn_primary">提交</button>


<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
<script type="text/javascript" src="../lib/common.js"></script>
<script type="text/javascript">
    function loop2() {
        var code = $("#code").val();
        setInterval(function (){
            ajaxGET({}, env.backend_url + "/task/query?code=" + code, function (result) {
                var resData = result.data;
                console.log(resData.code + "：" + resData.progress)
            })
        }, 1000)
    }
</script>
</body>
</html>